package indi.cyh.fastservice.controller;


import indi.cyh.fastservice.base.BaseController;
import indi.cyh.fastservice.base.BaseControllerImpl;
import indi.cyh.fastservice.base.entity.http.ResponseBase;
import indi.cyh.fastservice.base.request.BaseSaveRequest;
import indi.cyh.fastservice.biz.TestBiz;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Api(tags = "测试控制器")
@RequestMapping("/test/")
@RestController
public class TestController extends BaseControllerImpl<TestBiz> implements BaseController {


    @ApiOperation(value = "外部服务请求-测试")
    @PutMapping("/external-service-test")
    public ResponseBase externalServiceTest() {
        try {
            return super.resultTool.getOverResult(biz.externalServiceTest(), "请求失败!", "请求成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return resultTool.getExceptionResult("", "", e);
        }
    }


}
